<template>
	<view>
		<view style="height: 20rpx;"></view>
		<view class="inp">
			<view>真实姓名</view>
			<input type="text" v-model="name" placeholder="请输入"/>
		</view>
		<view class="inp">
			<view>身份证号</view>
			<input type="text" v-model="identityId" placeholder="请输入"/>
		</view>
		<view class="bottom">
			<view class="btn" @click="back">取消</view>
			<view class="btn1" @click="send">提交认证</view>
		</view>
	</view>
</template>

<script>
	import { realNameAuth,realNameAuthRZ } from '@/services/api/index';
	export default {
		data() {
			return {
				name:"",
				identityId:""
			}
		},
		methods: {
			back(){
				uni.navigateBack()
			},
			async send(){
				let data={
					name:this.name,
					identityId:this.identityId
				}
				const res=await realNameAuth(data)
				if(res.data){
					uni.showToast({
						icon:'none',
						title:'提交成功'
					})
					setTimeout(()=>{
						uni.navigateBack()
					},500)
				}else{
					uni.showToast({
						icon:'none',
						title:'身份信息不匹配请重新输入'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F5F5F5;
	}
	.bottom{
		padding: 40rpx;
		background-color: #fff;
		position: fixed;
		width: 100%;
		bottom:0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.btn{
			width: 327rpx;
			height: 96rpx;
			background: #F5F5F5;
			border-radius: 48rpx;
			text-align: center;
			line-height: 96rpx;
			font-size: 32rpx;
		}
		.btn1{
			width: 327rpx;
			height: 96rpx;
			background: #FABB3C;
			border-radius: 48rpx;
			text-align: center;
			line-height: 96rpx;
			font-size: 32rpx;
			color:#fff;
		}
	}
	.inp{
		width: 100%;
		background-color: #fff;
		padding: 34rpx 40rpx;
		display: flex;
		align-items: center;
		border-bottom: 1px solid #F5F5F5;
		input{
			flex:1;
			margin-left: 40rpx;
		}
	}
</style>
